﻿﻿﻿﻿﻿
<%@ page language="java" contentType="text/html; charset=UTF-8"
		 pageEncoding="UTF-8" isELIgnored="false" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

	<head>
		<meta charset="UTF-8">
		<title>小米手机列表</title>
		<link rel="stylesheet" type="text/css" href="css/style.css"></link>
		<link rel="stylesheet" type="text/css" href="css/layui/css/layui.css" />
		<style>
			.center{margin: 0 auto;}
			.next{
				height: 50px;
				width: 200px;
			}
			.btn_next{
				height: 50px;
				width: 300px;
			}

			.active a{
				color: #F0FFFF;
				background: -webkit-linear-gradient(top,#fece34,#d8a605);
				background: -moz-linear-gradient(top,#fece34,#d8a605);
				background: linear-gradient(top,#fece34,#d8a605);
			}
			.btn_next ul li{
				float: left;
			}
			.btn_t_b {
				width: 50px;
			}
			.btn_t{display: inline-block;}
		</style>
	</head>
	<script src="css/bootstrap/3.3.6/jquery.min.js"></script>

	<body>
	<!-- start header -->
	<jsp:include page="include/top.jsp"></jsp:include>

	<!--end header -->

	<!-- start banner_x -->
	<jsp:include page="include/seacher.jsp"></jsp:include>
	<!-- end banner_x -->

	<!-- start banner_y -->
	<!-- end banner -->

	<!-- start danpin -->
	<div class="danpin center">

		<div class="biaoti center">小米手机</div>

		<div class="main center">

			<%--				<c:forEach items="${products}" var="product">--%>

			<%--				<div class="mingxing fl mb20" style="border:2px solid #fff;width:230px;cursor:pointer;" onmouseout="this.style.border='2px solid #fff'" onmousemove="this.style.border='2px solid red'">--%>
			<%--					<div class="sub_mingxing"><a href="xiangqing.html" ><img src="image/liebiao_xiaomi6.jpg" alt=""></a></div>--%>
			<%--					<div class="pinpai"><a href="xiangqing.html" > ${product.name} </a></div>--%>
			<%--					<div class="youhui"> ${product.subTitle} </div>--%>
			<%--					<div class="jiage"> ${product.price} 元</div>--%>
			<%--				</div>--%>

			<%--				</c:forEach>--%>


			<c:forEach items="${pageInfo.list}" var="product">
				<div class="mingxing fl mb20" style="border:2px solid #fff;width:230px;cursor:pointer;" onmouseout="this.style.border='2px solid #fff'" onmousemove="this.style.border='2px solid red'">
					<div class="sub_mingxing"><a href="/showProduct?product_id=${product.id}" ><img src="${path}/${product.id}.jpg" alt=""></a></div>
					<div class="pinpai"><a href="/showProduct?product_id=${product.id}" > ${product.name} </a></div>
					<div class="youhui"> ${product.subTitle} </div>
					<div class="jiage"> ${product.price} 元</div>
				</div>
			</c:forEach>


			<div class="clear"></div>
		</div>
	</div>


	<div class="next center">


				<c:if test="${item !=null}">
				<div class="btn_next center">
					<nav aria-label="Page navigation">
						<ul class="pagination">
							<li class="btn_t_b layui-btn"><a href="initPrd?pn=1&item=${item}">首页</a></li>
							<c:if test="${pageInfo.hasPreviousPage}">
								<li>
									<a class="layui-btn " href="initPrd?pn=${pageInfo.pageNum-1}&item=${item}" aria-label="Previous">
										<span aria-hidden="true">&laquo;</span>
									</a>
								</li>
							</c:if>
							<c:forEach items="${pageInfo.navigatepageNums}" var="navigatepageNums">
								<c:if test="${navigatepageNums==pageInfo.pageNum }">
									<li class="active"><a class="layui-btn ">${navigatepageNums }</a></li>
								</c:if>

								<c:if test="${navigatepageNums!=pageInfo.pageNum }">
									<li><a class="layui-btn " href="initPrd?pn=${navigatepageNums}&item=${item}">${navigatepageNums }</a></li>
								</c:if>
							</c:forEach>
							<c:if test="${pageInfo.hasNextPage}">
								<li>
									<a class="layui-btn " href="initPrd?pn=${pageInfo.pageNum+1}&item=${item}" aria-label="Next">
										<span aria-hidden="true">&raquo;</span>
									</a>
								</li>
							</c:if>
							<li class="btn_t_b layui-btn"><a href="initPrd?pn=${pageInfo.pages }&item=${item}">末页</a></li>
						</ul>
					</nav>
				</div>

	</c:if>
	<c:if test="${shuru !=null}">
		<div class="btn_next center">
			<nav aria-label="Page navigation">
				<ul class="pagination">

					<li class="btn_t_b layui-btn "><a id="redirectURL" href="searchproduct?pn=1&shuru=${shuru}">首页</a></li>
					<c:if test="${pageInfo.hasPreviousPage}">
						<li>
							<a class="layui-btn " href="searchproduct?pn=${pageInfo.pageNum-1}&shuru=${shuru}" aria-label="Previous">
								<span aria-hidden="true">&laquo;</span>
							</a>
						</li>
					</c:if>
					<c:forEach items="${pageInfo.navigatepageNums}" var="navigatepageNums">
						<c:if test="${navigatepageNums==pageInfo.pageNum }">
							<li class="active"><a class="layui-btn ">${navigatepageNums }</a></li>
						</c:if>
						<c:if test="${navigatepageNums!=pageInfo.pageNum }">
							<li><a class="layui-btn " href="searchproduct?pn=${navigatepageNums}&shuru=${shuru}">${navigatepageNums }</a></li>
						</c:if>
					</c:forEach>
					<c:if test="${pageInfo.hasNextPage}">
						<li>
							<a class="layui-btn " href="searchproduct?pn=${pageInfo.pageNum+1}&shuru=${shuru}" aria-label="Next">
								<span aria-hidden="true">&raquo;</span>
							</a>
						</li>
					</c:if>
					<li class="btn_t_b layui-btn"><a href="searchproduct?pn=${pageInfo.pages }&shuru=${shuru}">末页</a></li>
				</ul>
			</nav>
		</div>

	</c:if>


	</div>


	</div>
		

		<footer class="mt20 center">			
			<div class="mt20">小米商城|MIUI|米聊|多看书城|小米路由器|视频电话|小米天猫店|小米淘宝直营店|小米网盟|小米移动|隐私政策|Select Region</div>
			<div>©mi.com 京ICP证110507号 京ICP备10046444号 京公网安备11010802020134号 京网文[2014]0059-0009号</div> 
			<div>违法和不良信息举报电话：185-0130-1238，本网站所列数据，除特殊说明，所有数据均出自我司实验室测试</div>

		</footer>


	</body>
<!-- end danpin -->
<script type="text/javascript">
	function addCartLink() {
		var page = "/checkLogin";
		$.get(
				page,
				function (result) {
					if ("success" == result) {
						location.href("/Cart")
					}
					else {
						alert("未登录，请先登录！")
					}
				}
		);
		return false;
	// }
function  encode() {
		var url=$(#redirectURL).attr("href");
	    href = encodeURI(href);
	    $("#redirectUrl").attr("href",href);

}
</script>
